﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Data.Linq.Mapping;
using System.ComponentModel;

namespace NutriLeaf.Phone.Model
{
    [Table]
    public class ModuleVersion : INotifyPropertyChanged, INotifyPropertyChanging
    {
        private int moduleVersionID, versionNumber;
        private string versionName;

        [Column(IsPrimaryKey = true)]
        public int ModuleVersionID
        {
            get
            {
                return moduleVersionID;
            }
            set
            {
                NotifyPropertyChanging("ModuleVersionID");
                moduleVersionID = value;
                NotifyPropertyChanged("ModuleVersionID");
            }

        }


        [Column]
        public string VersionName
        {
            get
            {
                return versionName;
            }
            set
            {
                NotifyPropertyChanging("VersionName");
                versionName = value;
                NotifyPropertyChanged("VersionName");
            }

        }

        [Column]
        public int VersionNumber
        {
            get
            {
                return versionNumber;
            }
            set
            {
                NotifyPropertyChanging("VersionNumber");
                versionNumber = value;
                NotifyPropertyChanged("VersionNumber");
            }

        }

        public event PropertyChangedEventHandler PropertyChanged;

        public event PropertyChangingEventHandler PropertyChanging;

        private void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }
        private void NotifyPropertyChanging(string propertyName) { if (PropertyChanging != null) { PropertyChanging(this, new PropertyChangingEventArgs(propertyName)); } }
    }
}
